projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
747962e
)
inspector: Avoid overflow when editing doubles
author
Matthias Clasen
<mclasen@redhat.com>
Thu, 10 Mar 2016 00:40:06 +0000
(19:40 -0500)
committer
Matthias Clasen
<mclasen@redhat.com>
Thu, 10 Mar 2016 02:59:43 +0000
(21:59 -0500)
The adjustment double properties allow values from -G_MAXDOUBLE
to G_MAXDOUBLE, which leads to overflow when calculating
max - min / 10. To avoid that, simply use a fixed page_size of 1.0.
gtk/inspector/prop-editor.c
patch
|
blob
|
history
diff --git
a/gtk/inspector/prop-editor.c
b/gtk/inspector/prop-editor.c
index cd855adc22576a447edc4be189d60d5db7ae4653..2c75cc73cce2f1fdbaa3abe19e4a85cc32ad8bff 100644
(file)
--- a/
gtk/inspector/prop-editor.c
+++ b/
gtk/inspector/prop-editor.c
@@
-915,7
+915,7
@@
property_editor (GObject *object,
G_PARAM_SPEC_DOUBLE (spec)->minimum,
G_PARAM_SPEC_DOUBLE (spec)->maximum,
0.1,
-
MAX ((G_PARAM_SPEC_DOUBLE (spec)->maximum - G_PARAM_SPEC_DOUBLE (spec)->minimum) / 10, 0.1)
,
+
1.0
,
0.0);
prop_edit = gtk_spin_button_new (adj, 0.1, 2);